package main;

import control.GameControl;
import control.PlayerControl;
import dto.GameDto;
import service.GameService;
import ui.JFrameGame;
import ui.JPanelGame;

import javax.swing.*;

public class Main {
    public static void main(String[] args) {
        GameDto dto = new GameDto();//创建游戏数据源
        JPanelGame jPanelGame = new JPanelGame(dto);//创建游戏面板
        GameService gameService = new GameService(dto);//创建游戏逻辑块安装游戏数据源
        //创建优先级控制器，连接游戏面板与游戏逻辑块
        GameControl gameControl = new GameControl(jPanelGame,gameService);
        //创建玩家控制器，连接游戏控制器
        PlayerControl playerControl = new PlayerControl(gameControl);
        //安装玩家控制器
        jPanelGame.setGameControl(playerControl);
        //创建游戏窗口，安装游戏面板
        JFrameGame jFrameGame = new JFrameGame(jPanelGame);

    }
}
